import { Component, OnInit } from '@angular/core';
/*import { Http } from '@angular/http';*/
import { HttpClient, HttpInterceptor, HttpHandler, HttpRequest } from '@angular/common/http';
import 'rxjs/add/operator/switchMap';
import { Router, ActivatedRoute, ParamMap } from '@angular/router';
/*import { Http, Response, Headers, RequestOptions,URLSearchParams } from '@angular/http';*/
@Component( {
    templateUrl: './getpic.component.html',
    styleUrls: ['./getpic.component.css']
} )
export class GetpicComponent implements OnInit {

    getpic = { "DH": "170807024", "XH": "2", "AttachXH": "1"};
    constructor(
        private route: ActivatedRoute,
        private router: Router,
        private http: HttpClient ) {

    }


    ngOnInit() {

        /*this.route.paramMap
            .switchMap(( params: ParamMap ) =>{
                this.System = params.get( 'System' );
                this.Company = params.get('Company');
                this.BillName = params.get('Company');
                this.KeyId = params.get('Company');
                return Promise.resolve();
            })
            .subscribe(( ) => 0 );*/
    }

    gotoPic2() {

        // Pass along the hero id if available
        // so that the HeroList component can select that hero.
        // Include a junk 'foo' property for fun.

        this.router.navigate( ['/getpic2', { DH: this.getpic.DH, XH: this.getpic.XH, AttachXH:this.getpic.AttachXH}] );
    }

}
